import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ToBeEvaluatedComponent } from './to-be-evaluated/to-be-evaluated.component';
import {StuPageComponent} from './stu-page.component';
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {ShareModule} from '../../share/share.module';
import {RouterModule, Routes} from '@angular/router';
import {LoginActivate} from '../../core/auth/login.activate';
import { EvaluatedComponent } from './evaluated/evaluated.component';

const routes: Routes = [
  {
    path: '',
    component: StuPageComponent,
    children: [
      {
        path: 'to-be-evaluated',
        component: ToBeEvaluatedComponent,
        data: {
          breadcrumb: '待评价'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'evaluated',
        component: EvaluatedComponent,
        data: {
          breadcrumb: '已评价'
        },
        canActivate: [LoginActivate]
      },
      {
        path: '',
        redirectTo: 'to-be-evaluated',
        pathMatch: 'full'
      },
      {
        path: '**',
        component: ToBeEvaluatedComponent
      }
    ]
  }
];

@NgModule({
  declarations: [
    StuPageComponent,
    ToBeEvaluatedComponent,
    EvaluatedComponent]
  ,
  imports: [
    CommonModule,
    NgZorroAntdModule,
    FormsModule,
    ReactiveFormsModule,
    ShareModule,
    RouterModule.forChild(routes),
  ]
})
export class StuPageModule { }
